package com.lightningtrade.mapper;

import com.lightningtrade.domain.SysReview;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

@Mapper
public interface SysReviewMapper {

    // 新增评价
    int insertReview(SysReview sysReview);

    // 按用户查询评价
    List<SysReview> selectReviewsByUser(@Param("userId") int userId);

    // 按商品编号查询评价
    List<SysReview> selectReviewsByProduct(@Param("productId") int productId);

    // 按订单编号查询评价
    List<SysReview> selectReviewsByOrder(@Param("orderId") long orderId);

    // 删除评价
    int deleteReviewById(@Param("id") int id);
}
